﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IceClient
{
    public partial class Form1 : Form
    {
        private Ice.Communicator ic = null;
        Demo.HelloPrx hello = null;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Text = hello.sayHello(0);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                ic = Ice.Util.initialize();
                Ice.ObjectPrx obj = ic.stringToProxy("hello:tcp -p 10000");
                hello = Demo.HelloPrxHelper.uncheckedCast(obj);
                if (hello == null)
                    throw new ApplicationException("Invalid Proxy");

            }
            catch (Exception ex1)
            {
                this.textBox1.Text = ex1.Message;
            }
        }
    }
}
